﻿import QtQuick 2.15
import QtQuick.Controls 2.15

Item {
    width: screenWidth
    height: screenHeight

    Item{
        id:backGround
        anchors.fill: parent
    }

    Rectangle{
        anchors.fill: backGround
        color: "#09295c"
    }


    Rectangle{
        anchors.top: backGround.top
        anchors.topMargin: 210
        anchors.left: backGround.left
        anchors.leftMargin: 10
        color: "#0b49b0"
        border.width: 1
        border.color: "#008edd"
        width: 1060
        height: 1400


        Text{
            anchors.top: parent.top
            anchors.topMargin: 40
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"刀盘当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 20
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 刀盘当前位置
                id:knifeCurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.knifeCurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 20
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "刀盘复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2004","64")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2004","0")
                }
            }
        }

        Text{
            anchors.top: parent.top
            anchors.topMargin: 160
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"胶辊当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 140
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 胶辊当前位置
                id:rollerCurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.rollerCurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 140
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "胶辊复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2004","128")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2004","0")
                }
            }
        }


        Text{
            anchors.top: parent.top
            anchors.topMargin: 280
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"压力1当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 260
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 压力1当前位置
                id:stress01CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.stress01CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 260
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "压力1复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","256")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }

        Text{
            anchors.top: parent.top
            anchors.topMargin: 400
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"压力2当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 380
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 压力2当前位置
                id:stress02CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.stress02CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 380
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "压力2复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","512")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }

        Text{
            anchors.top: parent.top
            anchors.topMargin: 520
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"压力3当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 500
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 压力3当前位置
                id:stress03CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.stress03CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 500
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "压力3复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","1024")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }

        Text{
            anchors.top: parent.top
            anchors.topMargin: 650
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"前刀1当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 630
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 前刀1当前位置
                id:f_Knife01CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.f_knife01CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 630
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "前刀1复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","2048")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }
        Text{
            anchors.top: parent.top
            anchors.topMargin: 760
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"前刀2当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 740
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 前刀2当前位置
                id:f_Knife02CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.f_knife02CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 740
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "前刀2复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","4096")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }
        Text{
            anchors.top: parent.top
            anchors.topMargin: 880
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"前刀3当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 860
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 前刀3当前位置
                id:f_Knife03CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.f_knife03CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 860
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "前刀3复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","8192")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }
        Text{
            anchors.top: parent.top
            anchors.topMargin: 1000
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"后刀1当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 980
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 后刀1当前位置
                id:b_Knife01CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.b_knife01CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 980
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "后刀1复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","16384")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }
        Text{
            anchors.top: parent.top
            anchors.topMargin: 1120
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"后刀2当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 1100
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 后刀2当前位置
                id:b_Knife02CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.b_knife02CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 1100
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "后刀2复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","32768")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }
        Text{
            anchors.top: parent.top
            anchors.topMargin: 1240
            anchors.left: parent.left
            anchors.leftMargin: 50
            font.pixelSize: 50
            font.bold: true
            color: "white"
            text:"后刀3当前位置"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 1220
            anchors.left: parent.left
            anchors.leftMargin: 420
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 后刀3当前位置
                id:b_Knife03CurrentPoint
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.b_knife03CurrLocation
            }

        }


        Rectangle{
            anchors.top: parent.top
            anchors.topMargin: 1220
            anchors.left: parent.left
            anchors.leftMargin: 800
            width: 200
            height: 80
            radius: 10
            color:"#2b6ec5"

            Text {
                anchors.centerIn: parent
                font.pixelSize: 30
                font.bold: true
                color: "white"
                text: "后刀3复位"
            }

            MouseArea{
                anchors.fill: parent

                onPressed: {
                    parent.color = "#e44034"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","1")
                }

                onReleased: {
                    parent.color = "#2b6ec5"
                    Cpp_Connect.write_modbus_tcp_OneHoldingRegisters("2006","0")
                }
            }
        }
    }

}
